<?php
include 'header.php';
@$workers = dbSelectAll('select worker.name as worker_name,worker.id as worker_id,branch.name as branch_name,role.name as role_name,imgUrl,sex,role_id from worker 
							join branch on worker.branch_id=branch.id join role on worker.role_id=role.id where worker.role_id=2');
?>
				<div class='col-xs-10'>
					<div class='panel panel-primary'>
   						<div class='panel-heading'>
   							<div class='panel-title'>部门主管列表</div>
   						</div>
   						<div class='panel-body'>
							<?php foreach ($workers as $worker){?>
								<div class='col-xs-2'>
									<div class='thumbnail text-center'>
										<img src='img/worker/<?php echo $worker['imgUrl'];?>' class='branchNameListImg' />
										<div style='margin:5px;'>
											<span><?php echo $worker['worker_name'];?></span>
											&nbsp;
											<span><?php echo $worker['sex'];?></span>
										</div>
										<div>
											<span><?php echo $worker['branch_name'];?></span>
										</div>
										<div>
											<span>
												<a href='#advance<?php echo $worker['worker_id'];?>' data-toggle='modal'>升职</a>
												<div class='modal' id='advance<?php echo $worker['worker_id'];?>'>
													<div class='myDialog'>
														<div class='modal-content'>
															<div class='modal-header'>
																<div class='modal-title'>[<?php echo $worker['worker_name'];?>]升职处理</div>
															</div>
															<form class='form-horizontal' action='loginIn.php?worker_id=<?php echo $worker['worker_id'];?>' method='post'>
																<div class='modal-body'>
																	<div class='form-group'>
										   								<label class='col-xs-3 control-label' for='role_id'>员工职位</label>
										   								<div class='col-xs-9'>
										   									<input class='form-control' value='<?php echo $worker['role_name'];?>' disabled='disabled' />
										   								</div>
										   							</div>
																	<div class='form-group'>
										   								<label class='col-xs-3 control-label' for='role_id'>目标职位</label>
										   								<div class='col-xs-9'>
										   									<select class='form-control' id='role_id' name='role_id'>
										   										<option value='总监'>总监</option>
										   									</select>
										   								</div>
										   							</div>
																</div>
																<div class='modal-footer'>
																	<button class='btn btn-primary' type='submit'>确定</button>
																	<a class='btn btn-default' data-dismiss='modal'>返回</a>
																</div>
															</form>
														</div>
													</div>
												</div>
												<a href='#fall<?php echo $worker['worker_id'];?>' data-toggle='modal'>降职</a>
											</span>
										</div>
									</div>
								</div>
							<?php }?>
						</div>
					</div>
				</div>
			</div>
		</div>
	<script>
		$(function(){
			
		});
	</script>  
	</body>
</html>